package com.corpgovernment.organization.util;

import com.corpgovernment.common.enums.LogLevelEnum;
import com.corpgovernment.common.util.ThreadPoolService;

import java.util.Map;

public class LogHelper {

    public static void info(String title, String message) {
        LogHelper.log(LogLevelEnum.Info, title, message, null);
    }

    public static void info(String title, String message, Map<String, String> tagMaps) {
        LogHelper.log(LogLevelEnum.Info, title, message, tagMaps);
    }

    public static void error(String title, String message) {
        LogHelper.log(LogLevelEnum.Error, title, message, null);
    }

    public static void error(String title, String message, Map<String, String> tagMaps) {
        LogHelper.log(LogLevelEnum.Error, title, message, tagMaps);
    }

    public static void warn(String title, String message) {
        LogHelper.log(LogLevelEnum.Warn, title, message, null);
    }

    public static void warn(String title, String message, Map<String, String> tagMaps) {
        LogHelper.log(LogLevelEnum.Warn, title, message, tagMaps);
    }

    private static void log(LogLevelEnum levelEnum, String title, String message, Map<String, String> tagMaps) {
        ThreadPoolService.getInstance().writeCtripLog(levelEnum, title, message, tagMaps);
    }
}